import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './vuex/store'
import './registerServiceWorker'
//初始化所有样式
import 'reset-css';
import '@/assets/css/style.css'
//导入element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
//引入font-awsome
import '@/assets/css/font-awesome.css'
import '@/utils/axios'
import '@/mixins/mixins'
import '@/apis'
Vue.config.productionTip = false

router.beforeEach((to,from,next)=>{
	if (to.path==='/Signin') {
		localStorage.clear();
		next();
	} else{
		if (localStorage.getItem("token")) {
			next();
		} else{
			next({path:'/Signin',query:{redirect:to.path}})
		}
	}
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
